

<%inherit file="base.html" />

<%def name="main()">
    <%!
        from django.conf import settings
    %>

    ## 获取值
    ${settings.TEMPLATES[0]['DIRS'][0]}

    ## for 循环
    %for i in range(20):
        <input type="text" value="${i}"></input>
    %endfor

    ## 定义函数并使用
    <%
        def name():
            return 'my name is robinluo'
    %>
    <br>
    <input type="text" name="username" value="${name()}"/>

</%def>

<%def name="js()">
<script src="http://cdn.bootcss.com/jquery/2.2.0/jquery.js"></script>
</%def>